﻿using CPPEI;
using CPPEI.WebApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Demo
{
    [PostAction("sys","login","1.0")]
    public class LoginAction : BaseAction<LoginParams, LoginResult>
    {
        protected override ActionResult<LoginResult> OnExecute(ActionContext context, SysParams sysParams, LoginParams opParams)
        {
            CPPEI.WebApi.Config.Current.AuthProvider.Save("abc", TimeSpan.FromHours(1));
            LoginResult result = new LoginResult();
            result.Id = Test.Lib1.Class1.GetV().ToString();
            Logger.Info("test login action");
            return new ActionResult<LoginResult>(new ServiceResult(1));
        }
    }

    public class LoginParams
    {
        public string Id { get; set; }

        public string[] StrArr { get; set; }

        
    }

    public class LoginResult
    {
        public string Id { get; set; }
    }
}